package com.lianzhihui.romeex.mvp.presenter;

import android.content.Context;

import com.lianzhihui.romeex.bean.ProfitFindHomeBean;
import com.lianzhihui.romeex.mvp.model.HuaZhuanModelImp;
import com.lianzhihui.romeex.mvp.model.HuaZhuanModelInterface;
import com.lianzhihui.romeex.mvp.view.HuaZhuanActivityView;

//逻辑实现
public class HuaZhuanPresnterImp implements HuaZhuanModelInterface {

    private final HuaZhuanActivityView viewLayer;
    private final HuaZhuanModelImp modelImp;

    public HuaZhuanPresnterImp(Context context, HuaZhuanActivityView viewLayer) {
        this.viewLayer = viewLayer;
        modelImp = new HuaZhuanModelImp(context, this);
    }

    /**
     * 划转首页
     */
    public void requestFindHome(String coinNameCobo, String coinName) {
        modelImp.requestFindHome(coinNameCobo, coinName);
    }

    /**
     * 划转
     */
    public void requestTransfer(String coinNameCobo, String coinName, String amount, String transferType) {
        modelImp.requestTransfer(coinNameCobo, coinName, amount, transferType);
    }


    @Override
    public void responseFindHomeSuccess(ProfitFindHomeBean b) {
        viewLayer.responseFindHomeSuccess(b);
    }

    @Override
    public void responseTransSuccess() {
        viewLayer.responseTransSuccess();
    }


    @Override
    public void onFailure() {
        viewLayer.setFailure();
    }
}
